package com.power.sifa.info.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  法律关键词实体类
*/

@Entity
@ApiModel(value="法律关键词")
@Data
@Table(name="Law_keyword",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Law_keyword.Law_keywordPK.class) 用于复合组件
public class Law_keyword extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_law_keyword")
    @SequenceGenerator(name = "seq_law_keyword", sequenceName = "SEQ_LAW_KEYWORD", allocationSize = 1)
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private Integer id;

    @ApiModelProperty(value = "法律编码")
    private String docid;

    @ApiModelProperty(value = "条文编码")
    private String provisionid;

    @ApiModelProperty(value = "关键词")
    private String word;

    @ApiModelProperty(value = "类型")
    private Integer type;

    @ApiModelProperty(value = "删除标志")
    private Integer deleted;

    /**
     *  类型文本
     */
    @Transient
    @FieldEnumText(eum="", valuefield="type")
    private String type_text;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("docid", this.getDocid());
        map.put("provisionid", this.getProvisionid());
        map.put("word", this.getWord());
        map.put("type_text", this.type_text);
        map.put("type", this.getType());
        map.put("deleted", this.getDeleted());
        return map;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (Integer) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Law_keywordPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (Integer)key;

        //Law_keywordPK pk = (Law_keywordPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}